import 'package:library_base/entities/generated/json/base/json_field.dart';
import 'package:library_base/entities/generated/json/tasks_entity.g.dart';
import 'dart:convert';

@JsonSerializable()
class TasksEntity {
  late String purchaseId;
  late String purchaseOrderNumber;
  late double goodsCount;
  late String supplierName;
  late String remark;
  late String createTime;

  String get remarkStr => remark.isEmpty ? "":remark;

  @override
  bool operator ==(Object other) =>
      identical(this, other) ||
      other is TasksEntity &&
          runtimeType == other.runtimeType &&
          purchaseId == other.purchaseId &&
          purchaseOrderNumber == other.purchaseOrderNumber &&
          goodsCount == other.goodsCount &&
          supplierName == other.supplierName &&
          remark == other.remark &&
          createTime == other.createTime;

  @override
  int get hashCode =>
      purchaseId.hashCode ^
      purchaseOrderNumber.hashCode ^
      goodsCount.hashCode ^
      supplierName.hashCode ^
      remark.hashCode ^
      createTime.hashCode;
  bool isSelect = false;

  TasksEntity();

  factory TasksEntity.fromJson(Map<String, dynamic> json) => $TasksEntityFromJson(json);

  Map<String, dynamic> toJson() => $TasksEntityToJson(this);

  @override
  String toString() => json.encode(this);
}
